from django.db import models

# Create your models here.
class User(models.Model):
    username = models.CharField(max_length=60) # 用户名1
    password = models.CharField(max_length=255) # 密码
    level = models.IntegerField(default=10)  # 积分
    userr = models.IntegerField(default=0)



class KeCheng(models.Model):
    kecheng_name = models.CharField(max_length=20)  # 课程名称
    price = models.IntegerField() # 课程价格
    number = models.IntegerField() # 购买人数


class Gou(models.Model):
    kecheng = models.ForeignKey(KeCheng,on_delete=models.CASCADE,null=True,blank=True)
    user = models.ForeignKey(User,on_delete=models.CASCADE,null=True,blank=True)

